var pokerPlanner;!function(){"use strict";var e,t,n,r={"./src/index.tsx":function(e,t,n){n.r(t);var r,o,a,i,s=n("./node_modules/@babel/runtime/helpers/esm/jsx.js"),u="/",c=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),l=n("./node_modules/firebase/auth/dist/esm/index.esm.js"),d=n("./node_modules/firebase/app/dist/esm/index.esm.js"),f={apiKey:"AIzaSyAMO8Kwj7ChDikQKJzA7KCp-LYkXDFcKYI",appId:"1:241782390439:web:c10021e740161f63d1a582",authDomain:"tst-project-b3fc3.firebaseapp.com",databaseURL:"https://tst-project-b3fc3-default-rtdb.europe-west1.firebasedatabase.app",messagingSenderId:"241782390439",projectId:"tst-project-b3fc3",storageBucket:"tst-project-b3fc3.appspot.com"},m=n("./node_modules/react/index.js"),v=(0,m.createContext)(void 0),p=function(e){var t=e.children,n=(0,m.useState)(),r=(0,c.A)(n,2),o=r[0],a=r[1];return(0,m.useEffect)((function(){return void 0===o&&a((0,d.Wp)(f)),function(){void 0!==o&&((0,d.NM)(o),a(void 0))}}),[o]),void 0===o?null:(0,s.A)(v.Provider,{value:o},void 0,t)},_=function(){var e=(0,m.useContext)(v);if(void 0===e)throw new Error("useFirebaseAppContext can only be used in a FirebaseAppProvider");return e},b=(0,m.createContext)(void 0),A=function(e){var t=e.children,n=_(),r=(0,m.useState)(),o=(0,c.A)(r,2),a=o[0],i=o[1];return(0,m.useEffect)((function(){i((0,l.xI)(n))}),[n]),void 0===a?null:(0,s.A)(b.Provider,{value:a},void 0,t)},h=(0,m.createContext)(void 0),g=function(e){var t=e.children,n=function(){var e=(0,m.useContext)(b);if(void 0===e)throw new Error("useAuthContext can only be used in a AuthProvider");return e}(),r=(0,m.useState)(),o=(0,c.A)(r,2),a=o[0],i=o[1];return(0,m.useEffect)((function(){(0,l.zK)(n).then((function(e){var t=e.user;return i(t)}))}),[n]),void 0===a?null:(0,s.A)(h.Provider,{value:a},void 0,t)},y=function(){var e=(0,m.useContext)(h);if(void 0===e)throw new Error("useAnonymouslyContext can only be used in a AnonymouslyProvider");return e},O=n("./node_modules/firebase/database/dist/esm/index.esm.js"),C=(0,m.createContext)(void 0),k=function(e){var t=e.children,n=_(),r=(0,m.useState)(),o=(0,c.A)(r,2),a=o[0],i=o[1];return(0,m.useEffect)((function(){i((0,O.C3)(n))}),[n]),void 0===a?null:(0,s.A)(C.Provider,{value:a},void 0,t)},j=n("./node_modules/firebase/firestore/dist/esm/index.esm.js"),I=(0,m.createContext)(void 0),N=function(e){var t=e.children,n=_(),r=(0,m.useState)(),o=(0,c.A)(r,2),a=o[0],i=o[1];return(0,m.useEffect)((function(){return i((0,j.aU)(n)),function(){return i(void 0)}}),[n]),void 0===a?null:(0,s.A)(I.Provider,{value:a},void 0,t)},x=function(){var e=(0,m.useContext)(I);if(void 0===e)throw new Error("useFirestoreContext can only be used in a FirestoreProvider");return e},S=function(e){var t=e.children;return(0,s.A)(p,{},void 0,(0,s.A)(A,{},void 0,(0,s.A)(g,{},void 0,(0,s.A)(N,{},void 0,(0,s.A)(k,{},void 0,t)))))},w=n("./node_modules/@babel/runtime/helpers/esm/extends.js"),P=function(e){return{defaultMessage:" ",id:e}},T=n("./node_modules/react-intl/lib/src/components/message.js"),E=function(e){var t=e.id,n=e.values;return m.createElement(T.A,(0,w.A)({},P(t),{values:n}))},M=function(){return r||(r=(0,s.A)("div",{},void 0,(0,s.A)("h3",{},void 0,(0,s.A)(E,{id:"gameTask.empty.title"})),(0,s.A)("p",{},void 0,(0,s.A)(E,{id:"gameTask.empty.description"}))))},D=function(e){var t=e.children,n=e.title;return(0,s.A)("table",{className:"Table"},void 0,n&&(0,s.A)("caption",{className:"Table__Title"},void 0,n),(0,s.A)("tbody",{},void 0,t))},L=function(e,t){var n=x();return(0,m.useMemo)((function(){return(0,j.H9)(n,e,t)}),[n,e,t])},V=n("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),F=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,m.useMemo)((function(){var n=t.split(" ");return n.push(e),n.join(" ")}),[t,e])},B=["className"],G=function(e){var t=e.className,n=(0,V.A)(e,B),r=F("Button",t);return m.createElement("button",(0,w.A)({className:r},n))},Z=n("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),W=function(){return o||(o=(0,s.A)("span",{"aria-label":"Coffee",className:"Coffee",role:"img"},void 0,"☕"))},R=function(e){return e[e.coffee=-3]="coffee",e[e.reset=-1]="reset",e[e.unsure=-2]="unsure",e}({}),H=(0,Z.A)((0,Z.A)((0,Z.A)({},R.coffee,(0,s.A)(W,{})),R.reset," "),R.unsure,"?"),q=function(e){var t=e.isVoted,n=e.taskId,r=e.votes,o=L("task",n),a=(0,m.useMemo)((function(){return Object.values(r).some((function(e){return e!==R.reset}))}),[r]),i=(0,m.useMemo)((function(){return t?"game.reset":"game.reveal"}),[t]),u=(0,m.useCallback)((function(){return t?(0,j.mZ)(o,{isVoted:!1,votes:{}}):(0,j.mZ)(o,{isVoted:!0})}),[t,o]);return(0,s.A)(G,{className:"Button_Primary offset",disabled:!a,onClick:u,type:"button"},void 0,(0,s.A)(E,{id:i}))},K=function(e){var t=e.children,n=e.isVoted,r=e.option,o=e.taskId,a=e.userId,i=e.vote,u=L("task",o),c=(0,m.useCallback)((function(){(0,j.mZ)(u,(0,Z.A)({},"votes.".concat(a),r))}),[r,u,a]);return(0,s.A)(G,{className:"Button_Primary offset_ver",disabled:n||i===r,onClick:c,type:"button"},void 0,null!=t?t:r)},Q=function(e){var t=e.game,n=e.taskData,r=e.taskId,o=e.userId;return void 0===n?null:(0,s.A)(D,{},void 0,(0,s.A)("tr",{},void 0,t.optionList.map((function(e){return(0,s.A)("td",{className:"Table__Cell Table__Cell_Title Table__Cell_Control"},e,(0,s.A)(K,{isVoted:n.isVoted,option:e,taskId:r,userId:o,vote:n.votes[o]},e))})),(0,s.A)("td",{className:"Table__Cell Table__Cell_Title Table__Cell_Control"},void 0,(0,s.A)(K,{isVoted:n.isVoted,option:R.unsure,taskId:r,userId:o,vote:n.votes[o]},void 0,H[R.unsure])),(0,s.A)("td",{className:"Table__Cell Table__Cell_Title Table__Cell_Control"},void 0,(0,s.A)(K,{isVoted:n.isVoted,option:R.coffee,taskId:r,userId:o,vote:n.votes[o]},void 0,H[R.coffee])),(0,s.A)("td",{className:"Table__Cell Table__Cell_Title Table__Cell_Control"},void 0,(0,s.A)(K,{isVoted:n.isVoted,option:R.reset,taskId:r,userId:o,vote:n.votes[o]},void 0,H[R.reset]))),t.creatorId===o&&(0,s.A)("tr",{},void 0,(0,s.A)("td",{className:"GameItemControl__Cell GameItemControl__Cell_Reveal",colSpan:t.optionList.length+3},void 0,(0,s.A)(q,{isVoted:n.isVoted,taskId:r,votes:n.votes}))))},U=function(e){var t=(0,m.useState)(),n=(0,c.A)(t,2),r=n[0],o=n[1],a=L("user",e);return(0,m.useEffect)((function(){return(0,j.aQ)(a,o)}),[a]),r},z=function(e){var t=function(){var e=(0,m.useContext)(C);if(void 0===e)throw new Error("useDatabaseContext can only be used in a DatabaseProvider");return e}();return(0,m.useMemo)((function(){return(0,O.KR)(t,e)}),[t,e])},J=function(e,t){return(0,m.useEffect)((function(){return(0,O.Zy)(e,t)}),[t,e])},Y=function(e){var t=e.gameId,n=e.isCreator,r=e.isSelf,o=e.isVoted,a=e.memberId,i=e.votes,u=U(a),l=function(e){var t=z("user/".concat(e)),n=(0,m.useState)(),r=(0,c.A)(n,2),o=r[0],a=r[1];return J(t,(function(e){return a(e.val())})),o}(a),d=(0,m.useMemo)((function(){var e=["GameMember__Name","offset"];return n&&e.push("GameMember__Name_Creator"),r&&e.push("GameMember__Name_Self"),l===t&&e.push("GameMember__Name_Online"),e.join(" ")}),[t,n,r,l]),f=(0,m.useMemo)((function(){var e,t=null!==(e=i[a])&&void 0!==e?e:R.reset;return R.reset===t?H[R.reset]:o?R[t]?H[t]:t:"#"}),[o,a,i]);if(void 0===u||!u.exists())return null;var v=u.data().name;return(0,s.A)("tr",{className:"GameMember"},void 0,(0,s.A)("td",{className:"Table__Cell Table__Cell_Title"},void 0,(0,s.A)("p",{className:d,title:v},void 0,v)),(0,s.A)("td",{className:"Table__Cell Table__Cell_Control Table__Cell_Control_Fixed"},void 0,(0,s.A)("h4",{className:"offset_ver"},void 0,f)))},X=function(e){var t=e.game,n=e.gameId,r=e.taskData,o=e.title,a=e.userId,i=(0,m.useMemo)((function(){return Object.keys(t.memberIds).toSorted()}),[t.memberIds]),u=(0,m.useCallback)((function(e){return(0,s.A)(Y,{gameId:n,isCreator:t.creatorId===e,isSelf:a===e,isVoted:r.isVoted,memberId:e,votes:r.votes},e)}),[t.creatorId,n,r.isVoted,r.votes,a]);return(0,s.A)(D,{title:(0,s.A)("h4",{},void 0,o)},void 0,i.map(u))},$=function(e){var t=e.game,n=e.gameId,r=e.taskData,o=e.userId;return void 0===r?null:(0,s.A)(X,{game:t,gameId:n,taskData:r,title:r.title,userId:o})},ee=function(e){var t=e.game,n=e.gameId,r=e.taskId,o=e.userId,a=function(e){var t=(0,m.useState)(),n=(0,c.A)(t,2),r=n[0],o=n[1],a=L("task",e);return(0,m.useEffect)((function(){return(0,j.aQ)(a,o)}),[a]),r}(r),i=(0,m.useMemo)((function(){if(void 0!==a&&a.exists())return a.data()}),[a]);return(0,s.A)("div",{className:"GameTask"},void 0,(0,s.A)($,{game:t,gameId:n,taskData:i,userId:o}),(0,s.A)(Q,{game:t,taskData:i,taskId:r,userId:o}))},te=function(e){var t=e.game,n=e.gameId,r=e.taskId,o=e.userId;return void 0===r?a||(a=(0,s.A)(M,{})):(0,s.A)(ee,{game:t,gameId:n,taskId:r,userId:o})},ne=function(e){var t=x();return(0,m.useMemo)((function(){return(0,j.rJ)(t,e)}),[t,e])},re=n("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),oe=n("./node_modules/@babel/runtime/regenerator/index.js"),ae=n.n(oe),ie=n("./node_modules/react-hook-form/dist/index.esm.mjs"),se=["className"],ue=function(e){var t=e.className,n=(0,V.A)(e,se),r=(0,ie.xW)().formState,o=r.isDirty,a=r.isLoading,i=r.isSubmitting,s=r.isValid,u=r.isValidating,c=F("Button_Primary",t),l=!o||a||i||!s||u;return m.createElement(G,(0,w.A)({className:c,disabled:l},n))},ce=["className","id","name"],le=function(e){var t=e.className,n=e.id,r=e.name,o=(0,V.A)(e,ce),a=(0,ie.xW)().control,i=(0,ie.as)({control:a,name:r}).field,s=F("Input",t);return m.createElement("input",(0,w.A)({className:s,id:null!=n?n:r},i,o))},de=n("./node_modules/react-intl/lib/src/components/useIntl.js"),fe=function(e,t){var n=(0,de.A)();return(0,m.useMemo)((function(){return function(e){return function(t,n){return e.formatMessage(P(t),n)}}(n)(e,t)}),[e,n,t])},me=function(e){var t=e.defaultValues,n=(0,ie.mN)({defaultValues:t}),r=fe("task.title"),o=(0,m.useCallback)(function(){var r=(0,re.A)(ae().mark((function r(o){return ae().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.onSubmit(o);case 2:n.reset(t);case 3:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}(),[t,n,e]);return m.createElement(ie.Op,n,(0,s.A)("form",{onSubmit:n.handleSubmit(o)},void 0,(0,s.A)(D,{},void 0,(0,s.A)("tr",{},void 0,(0,s.A)("td",{className:"Table__Cell Table__Cell_Title"},void 0,(0,s.A)(le,{className:"TaskForm__Input",name:"title",placeholder:r})),i||(i=(0,s.A)("td",{className:"Table__Cell Table__Cell_Control Table__Cell_Control_Fixed"},void 0,(0,s.A)(ue,{className:"offset"},void 0,"+")))))))};function ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(n),!0).forEach((function(t){(0,Z.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _e,be,Ae,he,ge,ye,Oe=function(e){var t=e.creatorId,n=e.gameId,r=(0,m.useMemo)((function(){return{creatorId:t,gameId:n,isVoted:!1,title:"",votes:{}}}),[t,n]),o=ne("task"),a=L("game",n),i=(0,m.useCallback)((function(e){return(0,j.mZ)(a,{taskId:e.id})}),[a]),u=(0,m.useCallback)((function(e){return(0,j.gS)(o,pe(pe({},e),{},{createDate:(0,j.O5)()})).then(i)}),[i,o]);return(0,s.A)(me,{defaultValues:r,onSubmit:u})},Ce=function(){return _e||(_e=(0,s.A)("div",{},void 0,(0,s.A)("h3",{},void 0,(0,s.A)(E,{id:"task.empty.title"})),(0,s.A)("p",{},void 0,(0,s.A)(E,{id:"task.empty.description"}))))},ke=function(){},je=function(e){var t=e.action,n=e.className,r=e.index,o=e.onClick,a=void 0===o?ke:o,i=e.task,u=e.voteAve;return(0,s.A)("tr",{className:n},void 0,(0,s.A)("td",{className:"TaskItem__Cell Table__Cell Table__Cell_Control Table__Cell_Control_Fixed",onClick:a},void 0,(0,s.A)("p",{className:"offset_ver"},void 0,r+1)),(0,s.A)("td",{className:"TaskItem__Cell Table__Cell Table__Cell_Title",onClick:a},void 0,(0,s.A)("p",{className:"TaskItem__Title",title:i.title},void 0,i.title)),(0,s.A)("td",{className:"TaskItem__Cell Table__Cell Table__Cell_Control Table__Cell_Control_Fixed",onClick:a},void 0,(0,s.A)("p",{className:"offset_ver"},void 0,u)),t)},Ie=function(e){var t=e.game,n=e.gameId,r=e.index,o=e.task,a=e.taskId,i=e.taskIdSelect,u=e.voteAve,c=L("game",n),l=L("task",a),d=F(e.className,"TaskItem_Hover"),f=(0,m.useCallback)((function(){return(0,j.mZ)(c,{taskId:a})}),[c,a]),v=(0,m.useCallback)((function(){return a===t.taskId&&(void 0===i?(0,j.mZ)(c,{taskId:(0,j.CL)()}):(0,j.mZ)(c,{taskId:i})),(0,j.kd)(l)}),[t.taskId,c,l,a,i]);return(0,s.A)(je,{action:(0,s.A)("td",{className:"Table__Cell Table__Cell_Control Table__Cell_Control_Fixed"},void 0,(0,s.A)(G,{className:"Button_Danger offset_ver",onClick:v,type:"button"},void 0,"×")),className:d,index:r,onClick:f,task:o,voteAve:u})},Ne=n("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),xe=function(e){return Math.round(e.reduce((function(e,t){return e+t}),0)/e.length)},Se=function(e){var t=e.game,n=e.gameId,r=e.index,o=e.isCreator,a=e.task,i=e.taskId,u=e.taskIdSelect,c=(0,m.useMemo)((function(){var e=["TaskItem"];return i===t.taskId&&e.push("TaskItem_Current"),e.join(" ")}),[t.taskId,i]),l=function(e,t,n){return(0,m.useMemo)((function(){if(0===e.length)return H[R.reset];if(!t)return"#";var r=e.filter((function(e){return R[e]})),o=Math.min.apply(Math,[0].concat((0,Ne.A)(r)));return o?H[o]:n(e)}),[n,t,e])}((0,m.useMemo)((function(){return Object.values(a.votes).filter((function(e){return e!==R.reset}))}),[a.votes]),a.isVoted,xe);return o?(0,s.A)(Ie,{className:c,game:t,gameId:n,index:r,task:a,taskId:i,taskIdSelect:u,voteAve:l}):(0,s.A)(je,{className:c,index:r,task:a,voteAve:l})},we=new Date(0),Pe=function(e){var t=e.createDate;return[void 0===t?j.Dc.fromDate(we):t,e.title].join("_")},Te=function(e){var t=e.game,n=e.gameId,r=e.isCreator,o=e.taskList,a=(0,m.useMemo)((function(){return o.map((function(e){return{data:e.data(),id:e.id}})).toSorted((function(e,t){var n=Pe(e.data),r=Pe(t.data);return n===r?0:n>r?1:-1}))}),[o]),i=(0,m.useCallback)((function(e,o){var i,u=null!==(i=a[o+1])&&void 0!==i?i:a[o-1];return(0,s.A)(Se,{game:t,gameId:n,index:o,isCreator:r,task:e.data,taskId:e.id,taskIdSelect:null==u?void 0:u.id},e.id)}),[t,n,r,a]);return(0,s.A)(D,{title:be||(be=(0,s.A)("h4",{},void 0,(0,s.A)(E,{id:"task.list.title"})))},void 0,a.map(i))},Ee=function(e){var t=(0,m.useState)(),n=(0,c.A)(t,2),r=n[0],o=n[1],a=(0,m.useMemo)((function(){return(0,j._M)("gameId","==",e)}),[e]),i=function(e,t){return(0,m.useMemo)((function(){return(0,j.P)(e,t)}),[e,t])}(ne("task"),a);return(0,m.useEffect)((function(){return(0,j.aQ)(i,o)}),[i]),r},Me=function(e){var t=e.creatorId,n=e.game,r=e.gameId,o=e.userId,a=Ee(r),i=o===t;return void 0===a?null:(0,s.A)("div",{},void 0,(0,s.A)("div",{},void 0,a.empty?Ae||(Ae=(0,s.A)(Ce,{})):(0,s.A)(Te,{game:n,gameId:r,isCreator:i,taskList:a.docs})),i&&(0,s.A)("div",{},void 0,(0,s.A)(Oe,{creatorId:t,gameId:r})))},De=function(e){var t=e.game,n=e.gameId;!function(e){var t=y(),n=L("game",e);(0,m.useEffect)((function(){(0,j.mZ)(n,(0,Z.A)({},"memberIds.".concat(t.uid),!0))}),[t.uid,n])}(n),function(e){var t=y(),n=z(".info/connected"),r=z("user/".concat(t.uid));J(n,(function(t){!0===t.val()&&(0,O.yX)(r).remove().then((function(){(0,O.hZ)(r,e)}))}))}(n);var r=(0,m.useMemo)((function(){return t.data()}),[t]),o=y().uid;return(0,s.A)("div",{className:"GameItemContent"},void 0,(0,s.A)("div",{className:"GameItemContent__Header box"},void 0,(0,s.A)("div",{className:"box__row"},void 0,(0,s.A)("h2",{className:"GameItemContent__Title box__col box__col_xs_12 box__col_sm_5 box__col_md_4"},void 0,r.title," (",r.createDate.toDate().toLocaleDateString(),")"),(0,s.A)("h2",{className:"GameItemContent__Code box__col box__col_xs_12 box__col_sm_7 box__col_md_8"},void 0,n))),(0,s.A)("div",{className:"GameItemContent__Main box"},void 0,(0,s.A)("div",{className:"box__row"},void 0,(0,s.A)("div",{className:"box__col box__col_xs_12 box__col_sm_5 box__col_md_4"},void 0,(0,s.A)(te,{game:r,gameId:n,taskId:r.taskId,userId:o})),(0,s.A)("div",{className:"box__col box__col_xs_12 box__col_sm_7 box__col_md_8"},void 0,(0,s.A)(Me,{creatorId:r.creatorId,game:r,gameId:n,userId:o})))))},Le=n("./node_modules/react-router/dist/index.js"),Ve=function(){var e=(0,Le.g)().gameId,t=void 0===e?"":e,n=function(e){var t=(0,m.useState)(),n=(0,c.A)(t,2),r=n[0],o=n[1],a=L("game",e);return(0,m.useEffect)((function(){return(0,j.aQ)(a,o)}),[a]),r}(t);return void 0===n?null:n.exists()?(0,s.A)(De,{game:n,gameId:t}):(0,s.A)(Le.C5,{to:u})},Fe=function(e){var t=e.children,n=e.defaultValues,r=e.onSubmit,o=(0,ie.mN)({defaultValues:n});return m.createElement(ie.Op,o,(0,s.A)("form",{onSubmit:o.handleSubmit(r)},void 0,t))},Be=function(e){var t=e.children,n=e.htmlFor;return(0,s.A)("label",{className:"Label",htmlFor:n},void 0,t)},Ge=n("./node_modules/react-intl/src/components/message.js"),Ze=function(){var e=fe("game.new.placeholder");return(0,s.A)(D,{},void 0,he||(he=(0,s.A)("tr",{},void 0,(0,s.A)("td",{className:"Form__Cell"},void 0,(0,s.A)(Be,{htmlFor:"title"},void 0,(0,s.A)(Ge.A,{id:"game.new.label"}))))),(0,s.A)("tr",{},void 0,(0,s.A)("td",{className:"Form__Cell"},void 0,(0,s.A)(le,{name:"title",placeholder:e}))),ge||(ge=(0,s.A)("tr",{},void 0,(0,s.A)("td",{className:"Form__Cell"},void 0,(0,s.A)(ue,{className:"offset"},void 0,(0,s.A)(Ge.A,{id:"game.new.action"}))))))},We="/",Re="/:gameId",He=n("./node_modules/@remix-run/router/dist/router.js");function qe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ke(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qe(Object(n),!0).forEach((function(t){(0,Z.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qe,Ue,ze,Je,Ye,Xe,$e,et,tt,nt=function(e){var t=e.optionSetList,n=(0,Le.Zp)(),r=y(),o=ne("game"),a=(0,m.useMemo)((function(){var e={title:""};return 1===t.length&&(e.optionList=t[0].optionList),e}),[t]),i=(0,m.useCallback)((function(e){return(0,j.gS)(o,Ke(Ke({},e),{},{createDate:(0,j.O5)(),creatorId:r.uid})).then((function(e){n((0,He.tW)(Re,{gameId:e.id}))}))}),[r.uid,o,n]);return(0,s.A)(Fe,{defaultValues:a,onSubmit:i},void 0,ye||(ye=(0,s.A)(Ze,{})))},rt=function(){var e=function(){var e=(0,m.useState)(),t=(0,c.A)(e,2),n=t[0],r=t[1],o=ne("optionSet");return(0,m.useEffect)((function(){return(0,j.aQ)(o,(function(e){r(e.docs.map((function(e){return e.data()})))}))}),[o]),n}();return void 0===e?null:(0,s.A)(nt,{optionSetList:e})},ot=function(){var e=fe("game.join.placeholder");return(0,s.A)(D,{},void 0,Qe||(Qe=(0,s.A)("tr",{},void 0,(0,s.A)("td",{className:"Form__Cell"},void 0,(0,s.A)(Be,{htmlFor:"title"},void 0,(0,s.A)(Ge.A,{id:"game.join.label"}))))),(0,s.A)("tr",{},void 0,(0,s.A)("td",{className:"Form__Cell"},void 0,(0,s.A)(le,{name:"gameId",placeholder:e}))),Ue||(Ue=(0,s.A)("tr",{},void 0,(0,s.A)("td",{className:"Form__Cell"},void 0,(0,s.A)(ue,{className:"offset"},void 0,(0,s.A)(Ge.A,{id:"game.join.action"}))))))},at=function(){var e=(0,Le.Zp)(),t=(0,m.useMemo)((function(){return{gameId:""}}),[]),n=(0,m.useCallback)((function(t){e((0,He.tW)(Re,t))}),[e]);return(0,s.A)(Fe,{defaultValues:t,onSubmit:n},void 0,ze||(ze=(0,s.A)(ot,{})))},it=function(){return Je||(Je=(0,s.A)("div",{className:"GameNew box"},void 0,(0,s.A)("div",{className:"box__row"},void 0,(0,s.A)("div",{className:"box__col box__col_xs_12 box__col_sm_6"},void 0,(0,s.A)("div",{className:"GameNew__Item"},void 0,(0,s.A)(rt,{}))),(0,s.A)("div",{className:"box__col box__col_xs_12 box__col_sm_6"},void 0,(0,s.A)("div",{className:"GameNew__Item"},void 0,(0,s.A)(at,{}))))))},st=function(){return Ye||(Ye=(0,s.A)("div",{className:"box"},void 0,(0,s.A)(D,{},void 0,(0,s.A)("tr",{},void 0,(0,s.A)("td",{className:"Form__Cell"},void 0,(0,s.A)(Be,{htmlFor:"name"},void 0,(0,s.A)(E,{id:"user.name"})))),(0,s.A)("tr",{},void 0,(0,s.A)("td",{className:"Form__Cell"},void 0,(0,s.A)(le,{name:"name"}))),(0,s.A)("tr",{},void 0,(0,s.A)("td",{className:"Form__Cell"},void 0,(0,s.A)(ue,{className:"offset"},void 0,(0,s.A)(E,{id:"form.save"})))))))},ut=function(){var e=y(),t=L("user",e.uid),n=(0,m.useMemo)((function(){return{name:""}}),[]),r=(0,m.useCallback)((function(e){return(0,j.BN)(t,e)}),[t]);return(0,s.A)(Fe,{defaultValues:n,onSubmit:r},void 0,Xe||(Xe=(0,s.A)(st,{})))},ct=function(){var e,t=(e=y(),U(e.uid));return void 0===t?null:t.exists()?(0,s.A)(Le.BV,{},void 0,(0,s.A)(Le.qh,{element:et||(et=(0,s.A)(it,{})),path:"".concat(We,"*")}),(0,s.A)(Le.qh,{element:tt||(tt=(0,s.A)(Ve,{})),path:Re})):$e||($e=(0,s.A)(ut,{}))},lt=n("./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"),dt=n("./node_modules/@babel/runtime/helpers/esm/createClass.js"),ft=n("./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"),mt=n("./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"),vt=n("./node_modules/@babel/runtime/helpers/esm/inherits.js"),pt=n("./node_modules/baron/src/core.js"),_t=n.n(pt);function bt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function At(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bt(Object(n),!0).forEach((function(t){(0,Z.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ht(e,t,n){return t=(0,mt.A)(t),(0,ft.A)(e,gt()?Reflect.construct(t,n||[],(0,mt.A)(e).constructor):t.apply(e,n))}function gt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gt=function(){return!!e})()}var yt=0!==function(){var e=document.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",e.style.setProperty("msOverflowStyle","scrollbar"),document.body.appendChild(e);var t=document.createElement("div");e.appendChild(t);var n=e.offsetWidth-t.offsetWidth;return e.parentNode&&e.parentNode.removeChild(e),n}();function Ot(e){return"bar_".concat(e)}function Ct(e){return"track_".concat(e)}var kt=function(e){function t(e){var n;return(0,lt.A)(this,t),n=ht(this,t,[e]),(0,Z.A)(n,"instanceList",[]),(0,Z.A)(n,"isMount",!1),(0,Z.A)(n,"references",{scroll:(0,m.createRef)(),scroller:(0,m.createRef)()}),(0,Z.A)(n,"updateOnLayoutChange",function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var s=r&&!n;clearTimeout(n),n=setTimeout((function(){n=null,r||e.apply(void 0,a)}),t),s&&e.apply(void 0,a)}}((function(){n.isMount&&n.instanceList.forEach(n.update)}),300)),(0,Z.A)(n,"referencesInit",(function(e,t){return At(At({},e),{},(0,Z.A)((0,Z.A)({},Ot(t),(0,m.createRef)()),Ct(t),(0,m.createRef)()))})),(0,Z.A)(n,"renderScrollbar",(function(e){return m.createElement("div",{className:"Scroll__Track Scroll__Track_".concat(e),key:e,ref:n.references[Ct(e)]},m.createElement("div",{className:"Scroll__Bar Scroll__Bar_".concat(e),ref:n.references[Ot(e)]}))})),(0,Z.A)(n,"scrollInit",(function(e){return _t()({bar:n.references[Ot(e)].current,barOnCls:"Scroll_On_".concat(e),direction:e,impact:"scroller",root:n.references.scroll.current,scroller:n.references.scroller.current,track:n.references[Ct(e)].current})})),n.references=n.props.dirList.reduce(n.referencesInit,n.references),n}return(0,vt.A)(t,e),(0,dt.A)(t,[{key:"render",value:function(){return yt?m.createElement("div",{className:"Scroll",ref:this.references.scroll},m.createElement("div",{className:"Scroll__Scroller",ref:this.references.scroller},this.props.children),this.props.dirList.map(this.renderScrollbar)):this.props.children}},{key:"componentDidMount",value:function(){yt&&(this.instanceList=this.props.dirList.map(this.scrollInit),this.isMount=!0,this.updateOnLayoutChange())}},{key:"componentDidUpdate",value:function(){this.updateOnLayoutChange()}},{key:"update",value:function(e){e.update()}},{key:"componentWillUnmount",value:function(){this.isMount=!1,this.instanceList.forEach(this.dispose)}},{key:"dispose",value:function(e){e.dispose()}}])}(m.Component),jt=n("./node_modules/react-redux/dist/react-redux.mjs"),It=function(){return(0,jt.wA)()},Nt=jt.d4,xt=function(e,t){return function(n){return e(t(n)),n}};function St(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?St(Object(n),!0).forEach((function(t){(0,Z.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):St(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Pt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";(0,lt.A)(this,e),e.host=t}return(0,dt.A)(e,[{key:"getJSON",value:function(e){return e.json()}},{key:"getOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.headers,r=void 0===n?{}:n;return wt(wt({},e.options),{},{headers:wt(wt({},e.options.headers),r)},t)}},{key:"request",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;return this.fetch(t,e.host,n)}},{key:"fetch",value:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return fetch("".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"").concat(t),this.getOptions(n)).then((function(t){return e.getJSON(t)}))}))},{key:"requestLocal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.fetch(e,"/planning-poker/local")}}])}();(0,Z.A)(Pt,"host",""),(0,Z.A)(Pt,"options",{headers:{"Content-Type":"application/json"},method:"GET"});var Tt,Et,Mt,Dt,Lt=new Pt,Vt="currentLocale",Ft=n("./node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.mjs"),Bt=(0,Ft.Z0)({initialState:{current:"",data:{},list:[]},name:"locale",reducers:{getList:function(e,t){var n=t.payload;e.list=n.list},getMessages:function(e,t){var n=t.payload,r=n.data,o=n.language;e.data[o]=r},setCurrent:function(e,t){var n=t.payload;e.current=n}}}),Gt=function(e){return e[Bt.name]},Zt=function(e){return Gt(e).data},Wt=function(e){return Gt(e).list},Rt=function(e){return Gt(e).current},Ht=(0,Ft.Z0)({initialState:{load:{}},name:"status",reducers:{loadStart:function(e,t){var n=t.payload;e.load[n]=!0},loadStop:function(e,t){var n=t.payload;e.load[n]=!1}}}),qt=function(e,t){return function(e,t){return function(n){return e(t),n}}(e,Ht.actions.loadStop(t))},Kt=function(e){return e(Ht.actions.loadStart(Bt.actions.getList.type)),Lt.requestLocal("/api/v1/locale.json").then(xt(e,Bt.actions.getList)).then(qt(e,Bt.actions.getList.type))},Qt=function(e){return function(t){return localStorage.setItem(Vt,e),t(Bt.actions.setCurrent(e))}},Ut=function(e,t){var n=t(),r=Rt(n)||localStorage.getItem(Vt)||"ru";return e(Qt(r))},zt=function(e){return function(t){return t(Ht.actions.loadStart(Bt.actions.getMessages.type)),Lt.requestLocal("/api/v1/locale-".concat(e,".json")).then((function(n){return xt(t,Bt.actions.getMessages)({data:n,language:e}),n})).then(qt(t,Bt.actions.getMessages.type))}},Jt=function(e){return(0,s.A)("option",{value:e},e,e)},Yt=function(){var e=It(),t=Nt(Rt),n=Nt(Wt),r=Nt(Zt),o=(0,m.useState)(t),a=(0,c.A)(o,2),i=a[0],u=a[1],l=(0,m.useCallback)((function(e){u(e.target.value)}),[]);return(0,m.useEffect)((function(){r[i]?i!==t&&e(Qt(i)):e(zt(i))}),[e,i,t,r]),(0,s.A)("select",{className:"LocaleSelector",name:"locale",onBlur:l,onChange:l,value:i},void 0,n.map(Jt))},Xt=n("./node_modules/react-router-dom/dist/index.js"),$t=function(){return(0,s.A)("div",{className:"Header"},void 0,(0,s.A)("div",{className:"Header__Inner box"},void 0,(0,s.A)("h1",{className:"Header__Title"},void 0,(0,s.A)(Xt.N_,{className:"Header__TitleLink",to:u},void 0,Tt||(Tt=(0,s.A)(E,{id:"app.title"})))),Et||(Et=(0,s.A)("div",{className:"Header__Lang"},void 0,(0,s.A)(Yt,{})))))},en=function(e){var t=e.children;return(0,s.A)("div",{className:"Layout"},void 0,Mt||(Mt=(0,s.A)("header",{className:"Layout__Header"},void 0,(0,s.A)($t,{}))),(0,s.A)("div",{className:"Layout__Scroll"},void 0,(0,s.A)(kt,{dirList:["h","v"]},void 0,(0,s.A)("div",{className:"Layout__Inner"},void 0,(0,s.A)("main",{className:"Layout__Body"},void 0,t)))))},tn=function(){return(0,s.A)(en,{},void 0,(0,s.A)(S,{},void 0,(0,s.A)(Le.BV,{},void 0,(0,s.A)(Le.qh,{element:Dt||(Dt=(0,s.A)(ct,{})),path:"".concat(u,"*")}))))},nn=n("./node_modules/redux/dist/redux.mjs");function rn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function on(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rn(Object(n),!0).forEach((function(t){(0,Z.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var an=(0,Ft.Z0)({initialState:{host:""},name:"config",reducers:{update:function(e,t){var n=t.payload;return on(on({},e),n)}}}),sn=function(e){return function(t){return"".concat(t[e])}},un=sn("id"),cn=function(e){return function(t){return[e(t),t]}},ln=(cn(un),function(e){return function(t){return{data:Object.fromEntries(t.map(cn(e))),list:t.map(e)}}});ln(un);function dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dn(Object(n),!0).forEach((function(t){(0,Z.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var mn=ln(sn("_id")),vn=(0,Ft.Z0)({initialState:{data:{},list:[]},name:"example",reducers:{getList:function(e,t){var n=t.payload;return fn(fn({},e),mn(n.data))}}}),pn=(0,nn.HY)((0,Z.A)((0,Z.A)((0,Z.A)((0,Z.A)({},an.name,an.reducer),vn.name,vn.reducer),Bt.name,Bt.reducer),Ht.name,Ht.reducer)),_n={immutableCheck:!1,serializableCheck:!1,thunk:!0},bn=(0,Ft.U1)({devTools:!1,middleware:function(e){return e(_n)},reducer:pn});var An=function(e){return e[an.name]};function hn(e,t,n){return t=(0,mt.A)(t),(0,ft.A)(e,gn()?Reflect.construct(t,n||[],(0,mt.A)(e).constructor):t.apply(e,n))}function gn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gn=function(){return!!e})()}var yn,On=function(e){function t(e){var n;return(0,lt.A)(this,t),n=hn(this,t,[e]),(0,Z.A)(n,"state",void 0),e.dispatch((function(e){return e(Ht.actions.loadStart(an.actions.update.type)),Lt.requestLocal("/api/v1/config.json").then(xt(e,an.actions.update)).then(qt(e,an.actions.update.type))})),n}return(0,vt.A)(t,e),(0,dt.A)(t,[{key:"render",value:function(){return this.state?this.props.children:null}},{key:"componentDidUpdate",value:function(e){var t=this.props.config;e.config!==t&&(Pt.host=t.host,this.setState(t))}}])}(m.Component),Cn=(0,jt.Ng)((function(e){return{config:An(e)}}))(On),kn=function(e){return function(e){return e[Ht.name]}(e).load},jn=n("./node_modules/react-intl/lib/src/components/provider.js"),In=function(e){var t=e.children,n=It();(0,m.useEffect)((function(){n(Kt),n(Ut)}),[n]);var r,o=Nt(Rt),a=Nt((r=Bt.actions.getMessages.type,function(e){return kn(e)[r]})),i=Nt(function(e){return function(t){return Zt(t)[e]}}(o));return(0,m.useEffect)((function(){i||a||!o||n(zt(o))}),[n,a,o,i]),i?(0,s.A)(jn.A,{locale:o,messages:i},void 0,t):null},Nn=n("./node_modules/react-dom/client.js"),xn=document.getElementById("root");if(xn){var Sn=function(e){return function(){e.render(yn||(yn=(0,s.A)(m.StrictMode,{},void 0,(0,s.A)(jt.Kq,{store:bn},void 0,(0,s.A)(In,{},void 0,(0,s.A)(Xt.I9,{},void 0,(0,s.A)(Cn,{},void 0,(0,s.A)(tn,{}))))))))}}((0,Nn.H)(xn));Sn()}var wn=function(e){console.error("SW registration failed: ",e)},Pn=function(){"serviceWorker"in navigator&&navigator.serviceWorker&&navigator.serviceWorker.register("/planning-poker/sw.js").catch(wn)};window.removeEventListener("load",Pn),window.addEventListener("load",Pn)}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return r[e](n,n.exports,a),n.exports}a.m=r,e=[],a.O=function(t,n,r,o){if(!n){var i=1/0;for(l=0;l<e.length;l++){n=e[l][0],r=e[l][1],o=e[l][2];for(var s=!0,u=0;u<n.length;u++)(!1&o||i>=o)&&Object.keys(a.O).every((function(e){return a.O[e](n[u])}))?n.splice(u--,1):(s=!1,o<i&&(i=o));if(s){e.splice(l--,1);var c=r();void 0!==c&&(t=c)}}return t}o=o||0;for(var l=e.length;l>0&&e[l-1][2]>o;l--)e[l]=e[l-1];e[l]=[n,r,o]},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},a.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var o=Object.create(null);a.r(o);var i={};t=t||[null,n({}),n([]),n(n)];for(var s=2&r&&e;"object"==typeof s&&!~t.indexOf(s);s=n(s))Object.getOwnPropertyNames(s).forEach((function(t){i[t]=function(){return e[t]}}));return i.default=function(){return e},a.d(o,i),o},a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={main:0};a.O.j=function(t){return 0===e[t]};var t=function(t,n){var r,o,i=n[0],s=n[1],u=n[2],c=0;if(i.some((function(t){return 0!==e[t]}))){for(r in s)a.o(s,r)&&(a.m[r]=s[r]);if(u)var l=u(a)}for(t&&t(n);c<i.length;c++)o=i[c],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return a.O(l)},n=self.webpackChunkpokerPlanner=self.webpackChunkpokerPlanner||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var i=a.O(void 0,["vendor"],(function(){return a("./src/index.tsx")}));i=a.O(i),pokerPlanner=i}();